package com.yao.web;

import com.yao.context.AnnotationConfigWebApplicationContext;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.ServletContext;

@Slf4j
public class SpringTomcatWebApplicationInitializer implements WebApplicationInitializer{
    @Override
    public void onStartup(ServletContext servletContext) throws Exception {
        log.info("{}",servletContext);
        AnnotationConfigWebApplicationContext webApplicationContext = new AnnotationConfigWebApplicationContext();
        webApplicationContext.setServletContext(servletContext);
        servletContext.setAttribute("WebApplicationContext",webApplicationContext);

    }
}
